﻿using Bird.Core;
using Bird.Core.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bird.Services.Events
{
    public static class EventPublisherExtension
    {
        public static void EntityInserted<T>(this IEventPublisher publisher, T entity) where T : BaseEntity
        {
            publisher.Publish(new EntityInserted<T>(entity));
        }
        public static void EntityDeleted<T>(this IEventPublisher publisher, T entity) where T : BaseEntity
        {
            publisher.Publish(new EntityDeleted<T>(entity));
        }
        public static void EntityUpdated<T>(this IEventPublisher publisher, T entity) where T : BaseEntity
        {
            publisher.Publish(new EntityUpdated<T>(entity));
        }
    }
}
